import { RouteComponentProps } from 'react-router-dom';
import Store from '../store';

// 带 store 组件
export interface IStore {
  store?: Store;
}

// 路由页面组件
export interface IRoute<P = {}> extends RouteComponentProps<P> {}

// 默认带 store 页面组件
export interface IPage<P = {}> extends IStore, IRoute<P> {}

// 分页组件状态
export interface IPageState {
  data: any[];
  total: number;
  loading: boolean | string;
  search: object;
}

// 默认数据
export const defaultPageState = {
  data: [],
  total: 0,
  loading: false,
  search: {},
};
